<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <title>文章管理</title>
    <link rel="stylesheet" href="css/bootstrap.min.css"/>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <style>
        .table th, .table td {
            text-align: center;
            vertical-align: middle !important;
        }

        .col-md-12 {
            padding-top: 1.25rem;
        }

        .col-md-8 {
            padding-left: 0rem;
        }
    </style>
</head>
<body>
<div class="container-fluid">
    <!-- 标题 -->
    <div class="col-md-11">
        <h3>文章管理</h3>
    </div>
    <div class="divider">
        <HR
                style="FILTER: alpha(opacity = 100, finishopacity = 0, style = 3)"
                width="90%" color=#987cb9 SIZE=3 align=center>
    </div>

    <!-- 标签栏 -->

    <!-- 查询 -->
    <div class="col-md-8">
        <div class="col-lg-4">
            <form method="post" action="SearchServlet">
                <div class="input-group">
                    <span class="input-group-addon" id="basic-addon1">栏目:</span>
                    <input type="text" class="form-control" name="title" placeholder="查询....">
                    <span class="input-group-btn">
						<button class="btn btn-info" type="submit">查询</button>
					</span>
                </div>
            </form>
            <!-- /input-group -->
        </div>
        <!-- /.col-lg-6 -->
    </div>
    <!-- 删除，查看 -->
    <div class="col-md-4 text-right">
        <a id="delete" href="#" class="btn btn-danger">删除</a>
        <a id="view" class="btn btn-success" data-toggle="modal" data-target="#example">查看</a>
    </div>

    <!-- 表格 -->
    <form action="SearchServlet" method="post">
        <div class="row">
            <div class="col-sm-12 col-md-12">
                <table width="100%"
                       class="table table-bordered table-striped table-hover">
                    <tr>
                        <td><input type="checkbox"/></td>
                        <td>id</td>
                        <td>标题</td>
                        <td>发表时间</td>
                        <td>状态</td>
                        <td>浏览数</td>
                        <td>点赞数</td>
                    </tr>
                    <c:forEach items="${list }" var="list">
                        <tr>
                            <td><input type="checkbox"/></td>
                            <td>${list.aid}</td>
                            <td>${list.title }</td>
                            <td>${list.isstime }</td>
                            <td>${list.status }</td>
                            <td>${list.viewcount }</td>
                            <td>${list.like }</td>
                        </tr>
                    </c:forEach>
                </table>
            </div>
        </div>
    </form>
</div>
<%--模态框--%>
<div class="modal fade" id="example" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="exampleModalLabel">文章详情</h4>
            </div>

            <div class="modal-body">
                <form method="post" action="ViewServlet">
                    <div class="form-group">
                        <label for="recipient-title" class="control-label">标题:</label>
                        <input type="text" class="form-control" id="recipient-title">
                    </div>

                    <div class="form-group">
                        <label for="recipient-column" class="control-label">栏目:</label>
                        <input type="text" class="form-control" id="recipient-column">
                    </div>

                    <div class="form-group">
                        <label for="message-text" class="control-label">内容:</label>
                        <textarea class="form-control" id="message-text"></textarea>
                    </div>
                </form>
            </div>

            <div class="modal-footer ">
                <center>
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <!-- <button type="button" class="btn btn-primary">添加</button> -->
                </center>
            </div>
        </div>
    </div>
</div>

<!--分页 -->
<div>
    <nav style="text-align: center;" aria-label="Page navigation" class="navbar-fixed-bottom">
        <ul class="pagination ">
            <li>
                <a href="#" aria-label="Previous">
                    <span aria-hidden="true">&laquo;上一页</span>
                </a>
            </li>
            <li><a href="#">1</a></li>
            <li><a href="#">2</a></li>
            <li><a href="#">3</a></li>
            <li><a href="#">4</a></li>
            <li><a href="#">5</a></li>
            <li>
                <a href="#" aria-label="Next">
                    <span aria-hidden="true">下一页&raquo;</span>
                </a>
            </li>
        </ul>
    </nav>
</div>
</body>
</html>